<?php
/**
 * ModerationResultsRequest
 *
 * PHP version 5
 *
 * @category Class
 * @package  AmazonAdvertisingApi
 * @author   vv_guo
 * @link    https://gitee.com/HuaLiLiDeDiDiao/amazon-advertising-api
 */

/**
 * Sponsored Brands campaign management
 *
 * Create and manage Sponsored Brands campaigns.   To learn more about Sponsored Brands campaigns, see:   - [Sponsored Brands overview](guides/sponsored-brands/overview)  - [Sponsored Brands campaign structure](guides/sponsored-brands/campaigns/structure)  - [Get started with Sponsored Brands campaigns](guides/sponsored-brands/campaigns/get-started-with-campaigns)
 *
 * OpenAPI spec version: 4.0
 * 
 * Generated by:https://gitee.com/HuaLiLiDeDiDiao/amazon-advertising-api.git
 * AmazonAdvertisingApi Codegen version: 3.0.51
 */
/**
 * NOTE: This class is auto generated by the AmazonAdvertisingApi code generator program.
 *https://gitee.com/HuaLiLiDeDiDiao/amazon-advertising-api
 * Do not edit the class manually.
 */

namespace AmazonAdvertisingApi\Model;

use \ArrayAccess;
use \AmazonAdvertisingApi\ObjectSerializer;

/**
 * ModerationResultsRequest Class Doc Comment
 *
 * @category Class
 * @package  AmazonAdvertisingApi
 * @author   vv_guo
 * @link    https://gitee.com/HuaLiLiDeDiDiao/amazon-advertising-api
 */
class ModerationResultsRequest implements ModelInterface, ArrayAccess
{
    const DISCRIMINATOR = null;

    /**
      * The original name of the model.
      *
      * @var string
      */
    protected static $AmazonAdvertisingApiModelName = 'ModerationResultsRequest';

    /**
      * Array of property to type mappings. Used for (de)serialization
      *
      * @var string[]
      */
    protected static $AmazonAdvertisingApiTypes = [
        'version_id_filter' => '\AmazonAdvertisingApi\Model\VersionId[]',
        'id_type' => '\AmazonAdvertisingApi\Model\IdType',
        'ad_program_type' => '\AmazonAdvertisingApi\Model\ModerationResultsAdProgramType',
        'next_token' => '\AmazonAdvertisingApi\Model\NextToken',
        'max_results' => 'int',
        'moderation_status_filter' => '\AmazonAdvertisingApi\Model\ModerationStatus[]',
        'id' => '\AmazonAdvertisingApi\Model\Id'
    ];

    /**
      * Array of property to format mappings. Used for (de)serialization
      *
      * @var string[]
      */
    protected static $AmazonAdvertisingApiFormats = [
        'version_id_filter' => null,
        'id_type' => null,
        'ad_program_type' => null,
        'next_token' => null,
        'max_results' => 'int32',
        'moderation_status_filter' => null,
        'id' => null
    ];

    /**
     * Array of property to type mappings. Used for (de)serialization
     *
     * @return array
     */
    public static function AmazonAdvertisingApiTypes()
    {
        return self::$AmazonAdvertisingApiTypes;
    }

    /**
     * Array of property to format mappings. Used for (de)serialization
     *
     * @return array
     */
    public static function AmazonAdvertisingApiFormats()
    {
        return self::$AmazonAdvertisingApiFormats;
    }

    /**
     * Array of attributes where the key is the local name,
     * and the value is the original name
     *
     * @var string[]
     */
    protected static $attributeMap = [
        'version_id_filter' => 'versionIdFilter',
        'id_type' => 'idType',
        'ad_program_type' => 'adProgramType',
        'next_token' => 'nextToken',
        'max_results' => 'maxResults',
        'moderation_status_filter' => 'moderationStatusFilter',
        'id' => 'id'
    ];

    /**
     * Array of attributes to setter functions (for deserialization of responses)
     *
     * @var string[]
     */
    protected static $setters = [
        'version_id_filter' => 'setVersionIdFilter',
        'id_type' => 'setIdType',
        'ad_program_type' => 'setAdProgramType',
        'next_token' => 'setNextToken',
        'max_results' => 'setMaxResults',
        'moderation_status_filter' => 'setModerationStatusFilter',
        'id' => 'setId'
    ];

    /**
     * Array of attributes to getter functions (for serialization of requests)
     *
     * @var string[]
     */
    protected static $getters = [
        'version_id_filter' => 'getVersionIdFilter',
        'id_type' => 'getIdType',
        'ad_program_type' => 'getAdProgramType',
        'next_token' => 'getNextToken',
        'max_results' => 'getMaxResults',
        'moderation_status_filter' => 'getModerationStatusFilter',
        'id' => 'getId'
    ];

    /**
     * Array of attributes where the key is the local name,
     * and the value is the original name
     *
     * @return array
     */
    public static function attributeMap()
    {
        return self::$attributeMap;
    }

    /**
     * Array of attributes to setter functions (for deserialization of responses)
     *
     * @return array
     */
    public static function setters()
    {
        return self::$setters;
    }

    /**
     * Array of attributes to getter functions (for serialization of requests)
     *
     * @return array
     */
    public static function getters()
    {
        return self::$getters;
    }

    /**
     * The original name of the model.
     *
     * @return string
     */
    public function getModelName()
    {
        return self::$AmazonAdvertisingApiModelName;
    }



    /**
     * Associative array for storing property values
     *
     * @var mixed[]
     */
    protected $container = [];

    /**
     * Constructor
     *
     * @param mixed[] $data Associated array of property values
     *                      initializing the model
     */
    public function __construct(array $data = null)
    {
        $this->container['version_id_filter'] = isset($data['version_id_filter']) ? $data['version_id_filter'] : null;
        $this->container['id_type'] = isset($data['id_type']) ? $data['id_type'] : null;
        $this->container['ad_program_type'] = isset($data['ad_program_type']) ? $data['ad_program_type'] : null;
        $this->container['next_token'] = isset($data['next_token']) ? $data['next_token'] : null;
        $this->container['max_results'] = isset($data['max_results']) ? $data['max_results'] : null;
        $this->container['moderation_status_filter'] = isset($data['moderation_status_filter']) ? $data['moderation_status_filter'] : null;
        $this->container['id'] = isset($data['id']) ? $data['id'] : null;
    }

    /**
     * Show all the invalid properties with reasons.
     *
     * @return array invalid properties with reasons
     */
    public function listInvalidProperties()
    {
        $invalidProperties = [];

        if ($this->container['id_type'] === null) {
            $invalidProperties[] = "'id_type' can't be null";
        }
        if ($this->container['ad_program_type'] === null) {
            $invalidProperties[] = "'ad_program_type' can't be null";
        }
        if ($this->container['max_results'] === null) {
            $invalidProperties[] = "'max_results' can't be null";
        }
        if ($this->container['id'] === null) {
            $invalidProperties[] = "'id' can't be null";
        }
        return $invalidProperties;
    }

    /**
     * Validate all the properties in the model
     * return true if all passed
     *
     * @return bool True if all properties are valid
     */
    public function valid()
    {
        return count($this->listInvalidProperties()) === 0;
    }


    /**
     * Gets version_id_filter
     *
     * @return \AmazonAdvertisingApi\Model\VersionId[]
     */
    public function getVersionIdFilter()
    {
        return $this->container['version_id_filter'];
    }

    /**
     * Sets version_id_filter
     *
     * @param \AmazonAdvertisingApi\Model\VersionId[] $version_id_filter Filter by specific version id of the ad. The API will return the ad's all versions moderation status if this field is empty.
     *
     * @return $this
     */
    public function setVersionIdFilter($version_id_filter)
    {
        $this->container['version_id_filter'] = $version_id_filter;

        return $this;
    }

    /**
     * Gets id_type
     *
     * @return \AmazonAdvertisingApi\Model\IdType
     */
    public function getIdType()
    {
        return $this->container['id_type'];
    }

    /**
     * Sets id_type
     *
     * @param \AmazonAdvertisingApi\Model\IdType $id_type id_type
     *
     * @return $this
     */
    public function setIdType($id_type)
    {
        $this->container['id_type'] = $id_type;

        return $this;
    }

    /**
     * Gets ad_program_type
     *
     * @return \AmazonAdvertisingApi\Model\ModerationResultsAdProgramType
     */
    public function getAdProgramType()
    {
        return $this->container['ad_program_type'];
    }

    /**
     * Sets ad_program_type
     *
     * @param \AmazonAdvertisingApi\Model\ModerationResultsAdProgramType $ad_program_type ad_program_type
     *
     * @return $this
     */
    public function setAdProgramType($ad_program_type)
    {
        $this->container['ad_program_type'] = $ad_program_type;

        return $this;
    }

    /**
     * Gets next_token
     *
     * @return \AmazonAdvertisingApi\Model\NextToken
     */
    public function getNextToken()
    {
        return $this->container['next_token'];
    }

    /**
     * Sets next_token
     *
     * @param \AmazonAdvertisingApi\Model\NextToken $next_token next_token
     *
     * @return $this
     */
    public function setNextToken($next_token)
    {
        $this->container['next_token'] = $next_token;

        return $this;
    }

    /**
     * Gets max_results
     *
     * @return int
     */
    public function getMaxResults()
    {
        return $this->container['max_results'];
    }

    /**
     * Sets max_results
     *
     * @param int $max_results Sets a limit on the number of results returned by an operation.
     *
     * @return $this
     */
    public function setMaxResults($max_results)
    {
        $this->container['max_results'] = $max_results;

        return $this;
    }

    /**
     * Gets moderation_status_filter
     *
     * @return \AmazonAdvertisingApi\Model\ModerationStatus[]
     */
    public function getModerationStatusFilter()
    {
        return $this->container['moderation_status_filter'];
    }

    /**
     * Sets moderation_status_filter
     *
     * @param \AmazonAdvertisingApi\Model\ModerationStatus[] $moderation_status_filter Filter by specific moderation status.
     *
     * @return $this
     */
    public function setModerationStatusFilter($moderation_status_filter)
    {
        $this->container['moderation_status_filter'] = $moderation_status_filter;

        return $this;
    }

    /**
     * Gets id
     *
     * @return \AmazonAdvertisingApi\Model\Id
     */
    public function getId()
    {
        return $this->container['id'];
    }

    /**
     * Sets id
     *
     * @param \AmazonAdvertisingApi\Model\Id $id id
     *
     * @return $this
     */
    public function setId($id)
    {
        $this->container['id'] = $id;

        return $this;
    }
    /**
     * Returns true if offset exists. False otherwise.
     *
     * @param integer $offset Offset
     *
     * @return boolean
     */
    #[\ReturnTypeWillChange]
    public function offsetExists($offset)
    {
        return isset($this->container[$offset]);
    }

    /**
     * Gets offset.
     *
     * @param integer $offset Offset
     *
     * @return mixed
     */
    #[\ReturnTypeWillChange]
    public function offsetGet($offset)
    {
        return isset($this->container[$offset]) ? $this->container[$offset] : null;
    }

    /**
     * Sets value based on offset.
     *
     * @param integer $offset Offset
     * @param mixed   $value  Value to be set
     *
     * @return void
     */
    #[\ReturnTypeWillChange]
    public function offsetSet($offset, $value)
    {
        if (is_null($offset)) {
            $this->container[] = $value;
        } else {
            $this->container[$offset] = $value;
        }
    }

    /**
     * Unsets offset.
     *
     * @param integer $offset Offset
     *
     * @return void
     */
    #[\ReturnTypeWillChange]
    public function offsetUnset($offset)
    {
        unset($this->container[$offset]);
    }

    /**
     * Gets the string presentation of the object
     *
     * @return string
     */
    public function __toString()
    {
        if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
            return json_encode(
                ObjectSerializer::sanitizeForSerialization($this),
                JSON_PRETTY_PRINT
            );
        }

        return json_encode(ObjectSerializer::sanitizeForSerialization($this));
    }
}
